<template>
  <div class="about">
    <input type="number" v-model="num" max="100" min="0"/><br />
    <myson :num="num"></myson><br />
    <button value="add" @click="add">add</button><button value="subtract" @click="reduce">reduce</button>
  </div>
</template>
<script>
import myson from "@/components/MySon.vue";
export default {
  components: {
    myson,
  },
  data() {
    return {
      num: 0,
    };
  },
  methods: {
    add() {
      if(this.num<100)
      this.num += 5;
    },
    reduce() {
      if(this.num>=5)
      this.num -= 5;
    },
  },
};
</script>

